package ua.kpi.oblamskyiv.counter;

import ua.kpi.oblamskyiv.testcase.Answers;
import ua.kpi.oblamskyiv.testcase.answer.Answer;
import ua.kpi.oblamskyiv.testcase.question.Question;

public class MultipleCounter implements AnswersScoreCounter {
    @Override
    public double countScore(Question question, Answers answers) {
        int correct = 0;
        for (Answer answer : question.getCorrectAnswers()) {
            if (answers.contains(answer)) {
                correct++;
            }
        }
        int wrong = answers.size() - correct;

        return (correct - wrong);
    }
}
